#多项式的四则运算
library(pracma)
f=c(1,-2,-4,4,-3)
g=c(2,-5,-4,3)
res1=polydiv(4*f,g)
q1=res1$d
r1=res1$r
res2=polydiv(9*g,r1)
q2=res2$d
r2=res2$r
res3=polydiv(56*r1,r2)
q3=res3$d
r3=res3$r


f=function(x) -2*x^3/3 + 17*x^2/2 -203*x/6 +42
f(2)
f(3)
f(4)
f(5)
f(c(2,3,4,5))
